<section class="content" style="padding: 10px">
    <div class="row">
        <div class="col-12">
            <div class="card card-default">
                <div class="card-header">
                    <h3 class="card-title">搜索</h3>
                </div>


                <div class="card-body">
                    <form role="form" data-form="1" data-search-table-id="1" data-title="自定义标题" >
                        <div class="form-inline"  >
                            <div class="form-group">
                                <label  >姓名：</label>
                                <input type="text" class="form-control" name="real_name" placeholder="">
                            </div>
                            <div class="form-group">
                                <label  >手机号：</label>
                                <input type="text" class="form-control" name="phone" placeholder="">
                            </div>
                            <div class="form-group">
                                <label  >卡分类：</label>
                                <select name="card_cate_id" id="" class="selectpicker">
                                    {:options,$cardCate}
                                </select>
                            </div>
                            {if $adminInfo['role']==1}
                            <div class="form-group">
                                <label  >医院：</label>
                                <select name="hospital_id" id="" class="selectpicker">
                                    {:options,$hospitals}
                                </select>
                            </div>
                            {/if}
                            <div class="form-group" style="margin-left: 10px">
                                <button type="submit" class="btn btn-primary">提交</button>
                                <button type="reset" class="btn btn-default">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>




<div class="content">
    <div class="card-body table-responsive" style="padding-top: 0px">
        <a class="btn   btn-outline-primary btn-table-tool btn-dialog" href="{url card add_edit}" data-area="50%,50%" title="新增类别">新增</a>
    </div>
    <div class="card-body table-responsive" style="padding-top: 0px">
        <table data-table="1" data-url="{url card ajax_data }" id="table1" class="table table-hover">
            <thead>
            <tr>

                <th data-field="id" data-formatter="epiiFormatter">ID</th>
                <th data-field="real_name" data-formatter="epiiFormatter">姓名</th>
                <th data-field="phone" data-formatter="epiiFormatter">手机号</th>
                <th data-field="card_cate_name" data-formatter="epiiFormatter">卡分类</th>
                <th data-field="money" data-formatter="epiiFormatter">当前金额</th>
                <th data-field="recharge_money" data-formatter="epiiFormatter">充值金额</th>
                <th data-field="gift_money" data-formatter="epiiFormatter">赠送金额</th>
                <th data-field="hospital_name" data-formatter="epiiFormatter">所属医院</th>
                <th data-field="status" data-formatter="epiiFormatter.switch" data-on-change-url="{url card status }&id={id}">状态</th>
                <th data-field="addtime" data-formatter="epiiFormatter">时间</th>

                <th data-formatter="epiiFormatter.btns"
                    data-btns="edit,recharge,log"
                    data-edit-url="{url card add_edit}&id={id}"
                    data-edit-title="编辑：{name}"
                    data-del-url="{url card del }&id={id}"
                    data-del-title="删除：{name}"
                    data-area="50%,50%"
                >操作
                </th>
            </tr>
            </thead>
        </table>
    </div>

</div>
<script>
    //充值
    function recharge(field_value, row, index, field_name){
        return '<a class="btn btn-outline-info btn-sm  btn-dialog" href="?app=card@recharge&id=' + row.id + '" data-area="45%,35%" data-title="充值">充值</a>';
    }
    //卡记录
    function log(field_value, row, index, field_name){
        return '<a class="btn btn-outline-info btn-sm  btn-addtab" href="?app=card_log@index&card_id=' + row.id + '" data-area="45%,35%" data-title="【'+row.real_name+'】的【'+row.card_cate_name+'】卡记录">卡记录</a>';
    }
</script>
